1 | Exception locking surface |
VideoProgressView.java1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20public class VideoProgressView extends SurfaceView implements SurfaceHolder.Callback, Runnable {
@Override
public void surfaceCreated(SurfaceHolder holder) {
thread = new Thread(this);
drawing = true;
thread.start();
}
@Override
public void run() {
while (drawing) {
try {
myDraw();
Thread.sleep(80); //这里40毫秒更新一次.
} catch (Exception e) {
e.printStackTrace();
}
}
}
1 | private void myDraw() { |